home *** CD-ROM | disk | FTP | other *** search
/ Game Programming in C++ - Start to Finish / GameProgrammingS.iso / Peon / PeonSDK-Win32-1.0.0.exe / {app} / PeonMain / include / CEGUI / CEGUIGlobalEventSet.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-09-07  |  3.9 KB  |  136 lines

  1. /************************************************************************
  2.     filename:     CEGUIGlobalEventSet.h
  3.     created:    16/1/2005
  4.     author:        Paul D Turner
  5. *************************************************************************/
  6. /*************************************************************************
  7.     Crazy Eddie's GUI System (http:www.cegui.org.uk)
  8.     Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
  9.  
  10.     This library is free software; you can redistribute it and/or
  11.     modify it under the terms of the GNU Lesser General Public
  12.     License as published by the Free Software Foundation; either
  13.     version 2.1 of the License, or (at your option) any later version.
  14.  
  15.     This library is distributed in the hope that it will be useful,
  16.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  18.     Lesser General Public License for more details.
  19.  
  20.     You should have received a copy of the GNU Lesser General Public
  21.     License along with this library; if not, write to the Free Software
  22.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  23. *************************************************************************/
  24. #ifndef _CEGUIGlobalEventSet_h_
  25. #define _CEGUIGlobalEventSet_h_
  26.  
  27. #include "CEGUIEventSet.h"
  28. #include "CEGUISingleton.h"
  29.  
  30.  
  31. #if defined(_MSC_VER)
  32. #    pragma warning(push)
  33. #    pragma warning(disable : 4275)
  34. #endif
  35.  
  36. // Start of CEGUI namespace section
  37. namespace CEGUI
  38. {
  39.  
  40. class CEGUIEXPORT GlobalEventSet : public EventSet, public Singleton<GlobalEventSet>
  41. {
  42. public:
  43.     GlobalEventSet();
  44.     ~GlobalEventSet();
  45.  
  46.  
  47.     /*!
  48.     \brief
  49.         Return singleton System object
  50.  
  51.     \return
  52.         Singleton System object
  53.     */
  54.     static    GlobalEventSet&    getSingleton(void);
  55.  
  56.  
  57.     /*!
  58.     \brief
  59.         Return pointer to singleton System object
  60.  
  61.     \return
  62.         Pointer to singleton System object
  63.     */
  64.     static    GlobalEventSet*    getSingletonPtr(void);
  65.  
  66.  
  67.     /*!
  68.     \brief
  69.         Subscribes the the named Event.
  70.  
  71.     \note
  72.         If the named event does not exist it is added.
  73.  
  74.     \param name
  75.         String object containing the name of the Event to subscribe to.
  76.  
  77.     \param subscriber
  78.         Function or object that is to be subscribed to the Event.
  79.  
  80.     \return
  81.         Connection object that can be used to check the status of the Event connection and to disconnect (unsubscribe) from the Event.
  82.     */
  83.     virtual Event::Connection    subscribeEvent(const String& name, Event::Subscriber subscriber);
  84.  
  85.  
  86.     /*!
  87.     \brief
  88.         Subscribes the the specified group of the named Event.
  89.  
  90.     /note
  91.         If the named event does not exist it is added.
  92.  
  93.     \param name
  94.         String object containing the name of the Event to subscribe to.
  95.  
  96.     \param group
  97.         Group which is to be subscribed to.  Subscription groups are called in ascending order.
  98.  
  99.     \param subscriber
  100.         Function or object that is to be subscribed to the Event.
  101.  
  102.     \return
  103.         Connection object that can be used to check the status of the Event connection and to disconnect (unsubscribe) from the Event.
  104.     */
  105.     virtual Event::Connection    subscribeEvent(const String& name, Event::Group group, Event::Subscriber subscriber);
  106.  
  107.  
  108.     /*!
  109.     \brief
  110.         Fires the named event passing the given EventArgs object.
  111.  
  112.     \param name
  113.         String object holding the name of the Event that is to be fired (triggered)
  114.  
  115.     \param args
  116.         The EventArgs (or derived) object that is to be bassed to each subscriber of the Event.  Once all subscribers
  117.         have been called the 'handled' field of the event is updated appropriately.
  118.         
  119.     \param eventNamespace
  120.         String object describing the namespace prefix to use when firing the global event.
  121.  
  122.     \return
  123.         Nothing.
  124.     */
  125.     virtual void    fireEvent(const String& name, EventArgs& args, const String& eventNamespace = "");
  126. };
  127.  
  128. } // End of  CEGUI namespace section
  129.  
  130.  
  131. #if defined(_MSC_VER)
  132. #    pragma warning(pop)
  133. #endif
  134.  
  135. #endif    // end of guard _CEGUIGlobalEventSet_h_
  136.